# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BackupDR.V1.Model.NetworkInterface do
  @moduledoc """
  A network interface resource attached to an instance. s

  ## Attributes

  *   `accessConfigs` (*type:* `list(GoogleApi.BackupDR.V1.Model.AccessConfig.t)`, *default:* `nil`) - Optional. An array of configurations for this interface. Currently, only one access config,ONE_TO_ONE_NAT is supported. If there are no accessConfigs specified, then this instance will have no external internet access.
  *   `aliasIpRanges` (*type:* `list(GoogleApi.BackupDR.V1.Model.AliasIpRange.t)`, *default:* `nil`) - Optional. An array of alias IP ranges for this network interface. You can only specify this field for network interfaces in VPC networks.
  *   `internalIpv6PrefixLength` (*type:* `integer()`, *default:* `nil`) - Optional. The prefix length of the primary internal IPv6 range.
  *   `ipv6AccessConfigs` (*type:* `list(GoogleApi.BackupDR.V1.Model.AccessConfig.t)`, *default:* `nil`) - Optional. An array of IPv6 access configurations for this interface. Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there is no ipv6AccessConfig specified, then this instance will have no external IPv6 Internet access.
  *   `ipv6AccessType` (*type:* `String.t`, *default:* `nil`) - Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. This field is always inherited from its subnetwork.
  *   `ipv6Address` (*type:* `String.t`, *default:* `nil`) - Optional. An IPv6 internal network address for this network interface. To use a static internal IP address, it must be unused and in the same region as the instance's zone. If not specified, Google Cloud will automatically assign an internal IPv6 address from the instance's subnetwork.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. [Output Only] The name of the network interface, which is generated by the server.
  *   `network` (*type:* `String.t`, *default:* `nil`) - Optional. URL of the VPC network resource for this instance.
  *   `networkAttachment` (*type:* `String.t`, *default:* `nil`) - Optional. The URL of the network attachment that this interface should connect to in the following format: projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}.
  *   `networkIP` (*type:* `String.t`, *default:* `nil`) - Optional. An IPv4 internal IP address to assign to the instance for this network interface. If not specified by the user, an unused internal IP is assigned by the system.
  *   `nicType` (*type:* `String.t`, *default:* `nil`) - Optional. The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet.
  *   `queueCount` (*type:* `integer()`, *default:* `nil`) - Optional. The networking queue count that's specified by users for the network interface. Both Rx and Tx queues will be set to this number. It'll be empty if not specified by the users.
  *   `stackType` (*type:* `String.t`, *default:* `nil`) - The stack type for this network interface.
  *   `subnetwork` (*type:* `String.t`, *default:* `nil`) - Optional. The URL of the Subnetwork resource for this instance.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :accessConfigs => list(GoogleApi.BackupDR.V1.Model.AccessConfig.t()) | nil,
          :aliasIpRanges => list(GoogleApi.BackupDR.V1.Model.AliasIpRange.t()) | nil,
          :internalIpv6PrefixLength => integer() | nil,
          :ipv6AccessConfigs => list(GoogleApi.BackupDR.V1.Model.AccessConfig.t()) | nil,
          :ipv6AccessType => String.t() | nil,
          :ipv6Address => String.t() | nil,
          :name => String.t() | nil,
          :network => String.t() | nil,
          :networkAttachment => String.t() | nil,
          :networkIP => String.t() | nil,
          :nicType => String.t() | nil,
          :queueCount => integer() | nil,
          :stackType => String.t() | nil,
          :subnetwork => String.t() | nil
        }

  field(:accessConfigs, as: GoogleApi.BackupDR.V1.Model.AccessConfig, type: :list)
  field(:aliasIpRanges, as: GoogleApi.BackupDR.V1.Model.AliasIpRange, type: :list)
  field(:internalIpv6PrefixLength)
  field(:ipv6AccessConfigs, as: GoogleApi.BackupDR.V1.Model.AccessConfig, type: :list)
  field(:ipv6AccessType)
  field(:ipv6Address)
  field(:name)
  field(:network)
  field(:networkAttachment)
  field(:networkIP)
  field(:nicType)
  field(:queueCount)
  field(:stackType)
  field(:subnetwork)
end

defimpl Poison.Decoder, for: GoogleApi.BackupDR.V1.Model.NetworkInterface do
  def decode(value, options) do
    GoogleApi.BackupDR.V1.Model.NetworkInterface.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BackupDR.V1.Model.NetworkInterface do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
